/**
 * Company : Thai Informatic System Co., Ltd.
 * Created By : Dr.Tree
 * Created On : Oct 18, 2012  12:17:41 PM 
 * e-Mail : chatree@tis.co.th
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : apps.startall
 * File Name : StagingProcessing.java
 * TODO
 */
package apps.startall;

import javax.persistence.EntityManager;

import org.apache.log4j.Logger;

import apps.business.process.commons.customer.CustomerProcessing;
import apps.business.process.commons.project.ProjectProcessing;
import apps.business.process.commons.propertyunit.PropertyUnitProcessing;
import apps.business.process.construction.purchase.request.PurchaseRequestProcessing;
import apps.business.process.sales.booking.SalesBookingProcessing;
import apps.business.process.sales.receipted.ReceiptedInstallmentProcessing;

/**
 * @author chatree
 *
 */
public class StagingProcessing {
	
	private static final Logger log = Logger.getLogger(StagingProcessing.class);
	
	public static void main(String[] args) {
		try{
			
			try{
				//All Project is not Sync In Staging Only
				new ProjectProcessing().ProcessingNotSyncInStaging();
				
				//All Project In Promis Only
				new ProjectProcessing().ProcessingAll();
				
			}catch(Exception e){
				log.error(e.getMessage());
				System.err.println(e.getMessage());
			}
			
			try{
				//All Customer is not sync in Staging
				new CustomerProcessing().ProcessingNotSyncInStaging();
				
				//All Customer In Promis Only 
				//new CustomerProcessing().ProcessingInStagingAll("N", null);
				
			}catch(Exception e){
				log.error(e.getMessage());
				System.err.println(e.getMessage());
			}
			
			try{
				
				//All Property Unit is not sync in Staging
				new PropertyUnitProcessing().ProcessingNotSyncInStaging();
				
				//All Property Unit in Promis Only
				//new PropertyUnitProcessing().ProcessingInStagingAll("N", null);				
				
			}catch(Exception e){
				log.error(e.getMessage());
				System.err.println(e.getMessage());
			}
			
			try{
				
				//All Sales Booking , Contract in Promis Only
				//new SalesBookingProcessing().ProcessingInStagingAllSingle("N", null);
				
				//All Sales Booking,Contract only is not Sync In Staging Only
				new SalesBookingProcessing().ProcessingNotSyncInStaging();
				
				
			}catch(Exception e){
				log.error(e.getMessage());
				System.err.println(e.getMessage());
			}
			
			try{
				//Purchase Request
				//new PurchaseRequestProcessing().ProcessingPRAllInStagingIsSync("N", null);
				
				//All Purchase Request is not Staging
				new PurchaseRequestProcessing().ProcessingNotSyncInStaging();
				
			}catch(Exception e){
				log.error(e.getMessage());
				System.err.println(e.getMessage());
			}
			
			try{
				//Receipt 
				//All Receipt is not sync
				new ReceiptedInstallmentProcessing().ProcessingNotSyncInStaging();
				
			}catch(Exception e){
				log.error(e.getMessage());
				System.err.println(e.getMessage());
			}
			
			try{
				//
				
			}catch(Exception e){
				log.error(e.getMessage());
				System.err.println(e.getMessage());
			}
			
		}catch(Exception e){
			log.error(e.getMessage());
			System.err.println(e.getMessage());
		}
	}
}